/**
 * Created by 李伟伟 on 2019/10/4.
 */
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

//state在vuex中用于存放数据
let state = {
  userMessage:null
};

//mutations里存放的是方法，用户改变state里面的数据
let mutations = {
   userMeg(states,user){
     state.userMessage = user
   }
};

//实例化Vuex.store
const store = new Vuex.Store({
  state,
  mutations
});

//导出sore
export default store;
